<style>
    .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
        border-color: #e2e7eb;
        padding: 10px 14px;
    }
</style>
<div class="panel panel-inverse" data-sortable-id="table-basic-4" id="result">
    <div class="panel-heading">
        <small>卡券列表</small>
    </div>
    <div class="panel-body">
        <table id="data-table" class="table table-striped table-bordered">
            <thead>
            <tr>
                <th>卡券ID</th>
                <th>图标</th>
                <th>分组</th>
                <th>类型</th>
                <th>卡券名称</th>
                <th>有效期</th>
                <th>适用店铺</th>
                <th>发行数量（张）</th>
                <th>创建时间</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <#if paginationResponse?has_content && paginationResponse.content?exists && paginationResponse.content?size gt 0>
                <#list paginationResponse.content as ct>
                        <tr>
                            <td>${ct.id}</td>
                            <td><img class="coupon-preview" src="${baseImage}${ct.image}"/></td>
                            <td>
                                <#list groupMap as group>
                                <#if group.id == ct.groupId >
                                     ${group.name}
                                </#if>
                                </#list>
                            </td>
                            <td>
                                <#if ct.type == 'T' >
                                集次卡
                                <#elseif ct.type == 'P'>
                                预存卡
                                <#else>
                                优惠券
                                </#if>
                            </td>
                            <td>${ct.name}</td>
                            <td>
                                <span style="border-radius: 5px;" class="badge badge-success badge-square">${ct.beginTime}</span></br>
                                <span style="border-radius: 5px;" class="badge badge-danger badge-square">${ct.endTime}</span>
                            </td>
                            <td>
                                <#if ct.storeIds != null && ct.storeIds != "" >
                                    <#list storeMap as ht>
                                        <#if ht.key == ct.storeIds >
                                        ${ht.value}
                                        </#if>
                                    </#list>
                                <#else>
                                全部店铺
                                </#if>
                            </td>
                            <td>
                                ${ct.total}
                            </td>
                            <td>
                                ${ct.createTime}
                            </td>
                            <td>
                                <#if ct.status == "A">
                                <span class="status-active">有效</span>
                                <#elseif ct.status == "C">
                                <span class="status-disabled">过期</span>
                                <#elseif ct.status == "D">
                                <span class="status-disabled">删除</span>
                                <#else>
                                <span class="status-disabled">无效</span>
                                </#if>
                            </td>
                            <td>
                                <#if ct.status != "D"><a class="label label-success small-btn" href="javascript:void(0)" onclick="javascript:getData('${rc.contextPath}/backend/coupon/couponEditInit/${ct.id}','displayArea')"><i class="fa fa-edit" title="编辑"></i>编辑</a></#if>
                                <#if ct.status != "D"><a class="label label-danger small-btn" href="javascript:removeCoupon('${ct.id}')"><i title="删除" class="fa fa-trash"></i>删除</a></#if>
                                <#if ct.status == "A"><a class="label label-success small-btn" href="javascript:sendCoupon('${ct.id}');" title="发券"><i class="fa fa-plus"></i>发券</a></#if>
                                <a class="label label-success small-btn" href="javascript:void(0)" onclick="javascript:getData('${rc.contextPath}/backend/userCoupon/list/?EQ_couponId=${ct.id}', 'displayArea')"><i class="fa fa-list" title="明细"></i>明细</a>
                            </td>
                        </tr>
                </#list>
            <#else>
                <tr class="gradeA even" role="row">
                    <td colspan="12" class="text-center">没有符合条件的数据！</td>
                </tr>
            </#if>
        </table>
    </div>
</div>

<!-- 分页组件 -->
<!-- recordBean 分页查询结果Bean
     action 分页请求URL
     formName 分页需要的查询参数的表单名称 -->
<@sp.pagination recordBean=paginationResponse action="${rc.contextPath}/backend/coupon/queryList" area="activityList" formName="activityForm"/>
